<template>
    <CommonDialog :dialogShow.sync="dialogShow" :title="'观赛人数填写'" @makeSure="makeSure" class="result">
        <template #content>
            <el-form label-width="120px" label="观赛人数" class="team" ref="raceRef">
                <el-form-item label="观赛人数" prop="users">
                    <CommonInput v-model="users" placeholder="请填写人数"></CommonInput>

                </el-form-item>

            </el-form>
        </template>
    </CommonDialog>
</template>

<script>
export default {
    props: {
        userDialogShow: {
            typeof: Boolean,
            default: false,
        },
        curRow: {
            typeof: Object,
            default: () => {
                return {
                    id: "",
                };
            },
        },
    },
    created() {
        console.log(789);
if(this.curRow.matchId){
    this.users = this.curRow.audienceNumber

}
    },
    data() {
        return {
            users: 0
        };
    },
    computed: {
        dialogShow: {
            get() {
                return this.userDialogShow;
            },
            set(v) {
                this.$emit("update:userDialogShow", v);
            },
        },
    },
    mounted() { },

    methods: {
        makeSure() {
            if(this.users<=0){
                return this.$message.error('人数不能为0')
            }
            this.$emit('makeSure', this.users)
       
        },

    },
};
</script>
<style lang="less" scoped>
.team {
    color: red;

    ::v-deep {
        .el-form-item__label {
            color: #333;
            font-size: 16px;
            font-weight: medium;
        }

        .el-input {
            width: 60px !important;
        }
    }
}
</style>